{% extends 'sub_page/base.html' %}
{% block content %}
    <div id="main">
      <div class="row box">
        <div class="col-md-9">
            {%  for item_articel in articles_is_recommend %}
          <h2 class="uptop">
            <i class="fa fa-arrow-circle-up" aria-hidden="true"></i>
            <a href="#" target="_blank">{{ item_articel.title }}</a>
          </h2>
            {%  endfor %}
        {%  for item in articles  %}
          <article class="article-list-1 clearfix">
            <header class="clearfix">
              <h1 class="post-title"><a href="{% url 'blog' item.id %}">{{ item.title }}</a></h1>
              <div class="post-meta">
                <span class="meta-span"><i class="fa fa-calendar"></i>{{ item.date_publish|date:"Y年m月d日 H:i:s" }}</span>
                <span class="meta-span"><i class="fa fa-folder-open-o"></i> <a href="{% url 'category' item.id %}" rel="category tag">{{ item.category.name }}</a></span>
                <span class="meta-span"><i class="fa fa-commenting-o"></i>
                    <a href="{% url 'blog'  item.id %}">{{ item.related_article.all|length }}条评论</a></span>

                <span class="meta-span hidden-xs">
                    <i class="fa fa-tags" aria-hidden="true"></i>

                    {% for item_tag in item.tag.all %}
                    <a href="{%  url 'tag' item_tag.name %}" rel="tag">{{ item_tag.name }}</a>,
                    {%  endfor %}
                </span>
              </div>
            </header>
            <div class="post-content clearfix">
              <p>{{ item.desc }}</p>
            </div>
          </article>
        {%  endfor %}
          <nav style="float:right">
            <ul class="pagination">
                {% if articles.has_previous %}
                    <li><a href="?page={{ articles.previous_page_number }}">上一页</a></li>
                {% endif %}
                {% for page in articles.paginator.page_range %}

                    <li {% if page == articles.number %}class="active"{% endif %} >
                        <a href="?page={{ page }}">{{ page }}</a>
                    </li>
                {% endfor %}
                {% if articles.has_next %}
                    <li><a href="?page={{ articles.next_page_number }}">下一页</a></li>
                {% endif %}

{#                <li class="active"><a href="#">1<span class="sr-only">(current)</span></a></li>#}
{#                <li><a href="#">2</a></li>#}
{#                <li><a href="#">3</a></li>#}
{#                <li><a href="#">4</a></li>#}
{#                <li><a href="#">5</a></li>#}
{#                <li><a href="#">6</a></li>#}
{#                <li><a href="#"><i class="fa fa-angle-right" aria-hidden="true"></i></a></li><li><a href="#"><i class="fa fa-angle-double-right" aria-hidden="true"></i></a></li>#}
            </ul>
          </nav>
        </div>
          {% include 'sub_page/right.html'%}
      </div>
    </div>
{% endblock %}